﻿using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour {

	private Rigidbody2D rig;//刚体组件

	public float speed=10f;//速度

	void Start () {
		//获取刚体组件
		rig = GetComponent<Rigidbody2D> ();
		rig.velocity = Vector3.up * speed;
	}

	void OnTriggerEnter2D(Collider2D other)

	{
		Destroy (other.gameObject);	
}


}
